class Solution {
public:
    /**
     * @param a: An integer
     * @param b: An integer
     * @return: The sum of a and b 
     */
    int aplusb(int a, int b) {
        // write your code here
        int sum = a ^ b;
        while (b) {            
            sum = aplusb(sum, (a & b) << 1);
        }
        
        return sum;
    }
};

class Solution {
public:
    /**
     * @param a: An integer
     * @param b: An integer
     * @return: The sum of a and b 
     */
    int aplusb(int a, int b) {
        // write your code here
        return b ? aplusb(a ^ b, (a & b) << 1) : a;
    }
};
